package cn.changein.framework.model.setting.contactType.mapper;

import cn.changein.framework.model.setting.contactType.entity.ContactType;
import cn.changein.framework.model.setting.contactType.model.params.ContactTypeParam;
import cn.changein.framework.model.setting.contactType.model.result.ContactTypeResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 单位类型 Mapper 接口
 * </p>
 *

 * @Date 2020-10-27
 * @Copyright: companyName
 * @Version 1.0
 * @Since JDK1.8
 */
public interface ContactTypeMapper extends BaseMapper<ContactType> {

    /**
     * 获取列表
     *

     * @Date 2020-10-27
     */
    List<ContactTypeResult> customList(@Param("paramCondition") ContactTypeParam paramCondition);

    /**
     * 获取map列表
     *

     * @Date 2020-10-27
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") ContactTypeParam paramCondition);

    /**
     * 获取分页实体列表
     *

     * @Date 2020-10-27
     */
    Page<ContactTypeResult> customPageList(@Param("page") Page page, @Param("paramCondition") ContactTypeParam paramCondition);

    /**
     * 获取分页map列表
     *

     * @Date 2020-10-27
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") ContactTypeParam paramCondition, @Param("deleteFlag") Integer deleteFlag);


    /**
     * 验证单位类型名称是否重复
     *
     * @param name
     * @param id
     * @param deleteFlag
     * @return
     */
    Integer countByName(@Param("name") String name, @Param("id") Long id, @Param("deleteFlag") Integer deleteFlag);

    /**
     * 批量删除单位类型
     *
     * @param contactTypeIds
     */
    void deleteList(@Param("contactTypeIds") List<Integer> contactTypeIds);

    /**
     * 查询实体
     *
     * @param param
     * @param deleteFlag
     * @return
     */
    ContactTypeResult findBySpec(@Param("param") ContactTypeParam param, @Param("deleteFlag") Integer deleteFlag);

    /**
     * 获得名字集合
     *

     */
    List<String> getNameList();

    /**
     * 根据单据类型id列表查询客户是否引用
     *
     * @param contactTypeIds
     * @return 可删除的单据类型ID列表
     */
    List<Integer> listDeleteIdsByClient(@Param("contactTypeIds") String[] contactTypeIds);

    /**
     * 根据单据类型id列表查询供应商是否引用
     *
     * @param deleteIdsByClient
     * @return 可删除的单据类型ID列表
     */
    List<Integer> listDeleteIdsBySupplier(@Param("deleteIdsByClient") List<Integer> deleteIdsByClient);
}
